package com.StringToInt;

public class convertStringToInt {
	private static String mxtp2 = "a2";
	private static String mxtp4 = "a4";
	private static String mxtp12 = "a12";

	private static String from = "";
	private static String to = "";

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("Mixtape Number: 12");
		getFromTo(mxtp12);
		System.out.println("from: " + from);
		System.out.println("to: " + to);
		System.out.println("- - - - - - - - - - - - -");

		System.out.println("Mixtape Number: 2");
		getFromTo(mxtp2);
		System.out.println("from: " + from);
		System.out.println("to: " + to);
		System.out.println("- - - - - - - - - - - - -");

		System.out.println("Mixtape Number: 4");
		getFromTo(mxtp4);
		System.out.println("from: " + from);
		System.out.println("to: " + to);
		System.out.println("- - - - - - - - - - - - -");
	}

	private static void getFromTo(String p_mxtp) {
		System.out.println("Recibido: " + p_mxtp);
		System.out.println("se extrae: " + p_mxtp.substring(1));
		System.out.println((Integer.parseInt(p_mxtp.substring(1)) - 1)
				+ " x 13 = ");
		System.out.println((Integer.parseInt(p_mxtp.substring(1)) - 1) * 13);
		from = "" + (((Integer.parseInt(p_mxtp.substring(1)) - 1) * 13) + 1);
		to = "" + Integer.valueOf(p_mxtp.substring(1)) * 13;
	}
}
